package subjectiveQuiz

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method("POST")
        url(value(producer("/api/v3/subjectiveQuizzes/students/1/assignments/1/quizzes/1")
                , consumer(regex("/api/v3/subjectiveQuizzes/students/\\d+/assignments/\\d+/quizzes/\\d+"))))
        headers {
            contentType(applicationJsonUtf8())
        }
        body("""
            {
                "userAnswer":"A"
            }
        """)
        bodyMatchers {
            jsonPath('$.userAnswer', byRegex("[\\s\\S]+"))
        }
    }
    response {
        status(201)
    }
}
